package com.sc.nft.entity.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sc.nft.enums.UserEquityPropsHoldingStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class UserEquityPropsDetailVO {

    @ApiModelProperty(value = "我的权益道具id")
    private Long id;

    @ApiModelProperty(value = "权益道具id")
    private Long equityPropsId;

    @ApiModelProperty(value = "名称")
    private String firstTitle;

    @ApiModelProperty(value = "缩略图")
    private String creationContent;

    @ApiModelProperty(value = "持有状态")
    private UserEquityPropsHoldingStatusEnum holdingStatus;

    @ApiModelProperty(value = "过期时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expiredTime;

    @ApiModelProperty(value = "使用时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date modifyTime;

    @ApiModelProperty(value = "获取规则地址")
    private String getRulesUrl;

    @ApiModelProperty(value = "当前时间戳")
    private Long expiredTimeStamp;

    @ApiModelProperty(value = "过期时间戳")
    private Long nowTimeStamp;

    @ApiModelProperty(value = "是否开启赠送")
    private Boolean isGift;

    @ApiModelProperty(value = "是否可以寄售")
    private Boolean isConsign = Boolean.FALSE;

    @ApiModelProperty(value = "购买价格")
    private String buyPrice;

    @ApiModelProperty(value = "是否寄售")
    private Boolean onConsign;

    @ApiModelProperty("特殊转增标识")
    private Boolean isSpecialGive;

    public void setBuyPrice(BigDecimal buyPrice) {
        this.buyPrice = buyPrice.setScale(2,BigDecimal.ROUND_DOWN).toPlainString();
    }
}
